package drds.binlog.server.netty.handler;

import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.handler.codec.replay.ReplayingDecoder;
import org.jboss.netty.handler.codec.replay.VoidEnum;

/**
 * 解析对应的header信息
 */
public class FixedHeaderFrameDecoder extends ReplayingDecoder<VoidEnum>
{

    protected Object decode(ChannelHandlerContext channelHandlerContext, Channel channel, ChannelBuffer channelBuffer, VoidEnum voidEnum)
            throws Exception
    {
        return channelBuffer.readBytes(channelBuffer.readInt());
    }
}
